#include "demo_app.h"

extern lv_font_t *simhei_24;

void create_demo_app()
{
    lv_obj_t *scr = lv_obj_create(NULL);
    lv_obj_remove_style_all(scr);

    static lv_style_t style;
    lv_style_init(&style);
    lv_style_set_text_font(&style, simhei_24);
    lv_style_set_text_color(&style, lv_color_white());
    lv_style_set_text_align(&style, LV_TEXT_ALIGN_LEFT);
    lv_style_set_bg_opa(&style, LV_OPA_100);
    lv_style_set_radius(&style, 5);
    lv_style_set_pad_all(&style, 8);

    lv_obj_t *label_title = lv_label_create(scr);
    lv_label_set_text(label_title, "问题解答价位表");
    lv_obj_set_style_bg_color(label_title, lv_color_make(181, 181, 181), LV_PART_MAIN);
    lv_obj_align(label_title, LV_ALIGN_TOP_MID, -100, 6);
    lv_obj_add_style(label_title, &style, LV_PART_MAIN);
    lv_obj_set_style_border_color(label_title, lv_color_make(76, 76, 76), LV_PART_MAIN);
    lv_obj_set_style_border_opa(label_title, LV_OPA_100, LV_PART_MAIN);
    lv_obj_set_style_border_width(label_title, 2, LV_PART_MAIN);
    lv_obj_set_style_border_side(label_title, LV_BORDER_SIDE_FULL, LV_PART_MAIN);

    lv_obj_t *label1 = lv_label_create(scr);
    lv_label_set_text(label1, "问题描述≤10字        500CNY");
    lv_obj_set_style_bg_color(label1, lv_color_make(255, 107, 107), LV_PART_MAIN);
    lv_obj_align_to(label1, label_title, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 10);
    lv_obj_add_style(label1, &style, LV_PART_MAIN);

    lv_obj_t *label2 = lv_label_create(scr);
    lv_label_set_text(label2, "问题描述≤20字        300CNY");
    lv_obj_set_style_bg_color(label2, lv_color_make(255, 165, 108), LV_PART_MAIN);
    lv_obj_align_to(label2, label1, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 10);
    lv_obj_add_style(label2, &style, LV_PART_MAIN);

    lv_obj_t *label3 = lv_label_create(scr);
    lv_label_set_text(label3, "问题描述+截图          80CNY");
    lv_obj_set_style_bg_color(label3, lv_color_make(223, 224, 103), LV_PART_MAIN);
    lv_obj_align_to(label3, label2, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 10);
    lv_obj_add_style(label3, &style, LV_PART_MAIN);

    static lv_ft_info_t info;
    info.name = "/sdcard/simhei.ttf";
    info.weight = 20;
    info.style = FT_FONT_STYLE_NORMAL;
    lv_ft_font_init(&info);

    lv_obj_t *label4 = lv_obj_create(scr);
    lv_obj_remove_style_all(label4);
    lv_obj_set_flex_flow(label4, LV_FLEX_FLOW_COLUMN);
    lv_obj_set_style_radius(label4, 0, LV_PART_MAIN);
    lv_obj_set_style_bg_color(label4, lv_color_make(125, 226, 98), LV_PART_MAIN);
    lv_obj_align_to(label4, label3, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 10);
    lv_obj_add_style(label4, &style, LV_PART_MAIN);
    lv_obj_set_style_radius(label4, 5, LV_PART_MAIN);
    lv_obj_set_height(label4, LV_SIZE_CONTENT);
    lv_obj_set_width(label4, lv_obj_get_width(label3));

    lv_obj_t *obj_label4 = lv_label_create(label4);
    lv_label_set_text(obj_label4, "详细问题描述+截图/日志  免费");

    obj_label4 = lv_label_create(label4);
    lv_label_set_text(obj_label4, "详细描述，截图全面，日志到位\n尽可能帮助你解决问题");
    lv_obj_set_style_text_font(obj_label4, info.font, LV_PART_MAIN);

    lv_obj_del(lv_scr_act());
    lv_scr_load(scr);
}